<?php
	$myfile = fopen("../json/data.json", "w") or die("Unable to open file!");
	$content=array();
	$username=$_GET["username"];
	$password=$_GET["password"];
	array_push($content,$username);
	array_push($content,$password);
	$txt = new stdClass();//创建一个对象
	$txt->username=$content;//给对象的data属性赋值
	echo "<br/><br/><br/>".json_encode($txt);//将对象类型转成json类型
	fwrite($myfile, json_encode($txt));//将转好的json写入文本
	fclose($myfile);//关闭文本
?>